# -*- coding: utf-8 -*-

from django.contrib.flatpages.models import FlatPage
from django.contrib.sites.models import Site
from arnagroup.base.models import TopMenuCategory, Banner
from base.models import Banner
from arnagroup.danismanlar.models import Danisman

def get_meta_data_tags(request):
    description = "" 
    keywords = ""
    banner=""
    
    try:
        description = FlatPage.objects.get(title = 'description').content
    except:
        pass
    try:
        keywords = FlatPage.objects.get(title = 'keywords').content
    except:
        pass
    try:
        topmenu = TopMenuCategory.objects.filter().order_by('-weight')
    except:
        pass
    try:
        banner = Banner.objects.get()
    except:
        pass
    try:
        danismanlar = Danisman.objects.filter(is_active=True).order_by('-weight')
    except:
        pass
      
    return {"keywords" : keywords,
            "description" : description,
            "topmenus": topmenu,
            "danismanlar":danismanlar,
            "banner":banner,
            }
        
def get_values(request):
    site = Site.objects.get_current()

    return {"site" : site.domain}
